#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL upperBound(LL a[],LL i,LL len,LL x)
{
    LL left=i+1,right=len,mid;
    while (left<right)
    {
        mid=left+(right-left)/2;
        if (a[mid]>x)
        {
            right=mid;
        }
        else
        {
            left=mid+1;
        }
    }
    return left;
}
int main_1085_2()
{
    LL N,p;
    scanf("%lld%lld",&N,&p);
    LL sequence[N]={0};
    for (LL i=0;i<N ;++i )
    {
        scanf("%lld",&sequence[i]);
    }
    sort(sequence,sequence+N);
    LL max_min_len=1;
    for (LL i=0;i<N ;++i )
    {
        LL j=upperBound(sequence,i,N,sequence[i]*p);
        max_min_len=max(max_min_len,(LL)(j-i));
    }
    printf("%lld",max_min_len);
    return 0;
}
